module bypassdataMux
(
    input 	wire 			rs1_bypassdata_ex_sel,
    input 	wire 			rs1_bypassdata_mem_sel,
    input 	wire 			rs1_bypassdata_wb_sel,
	input 	wire 			rs2_bypassdata_ex_sel,
    input 	wire 			rs2_bypassdata_mem_sel,	
	input 	wire 			rs2_bypassdata_wb_sel,
    input 	wire 			csr_bypassdata_ex_sel,
    input 	wire 			csr_bypassdata_mem_sel,	
	input 	wire 			csr_bypassdata_wb_sel,

	input 	wire 	[63:0]	gpr_bypassdata_ex,	
    input 	wire 	[63:0]	gpr_bypassdata_mem,
	input 	wire 	[63:0]	gpr_bypassdata_wb,
    input 	wire 	[63:0]	csr_bypassdata_ex,	
    input 	wire 	[63:0]	csr_bypassdata_mem,
	input 	wire 	[63:0]	csr_bypassdata_wb,

    output  wire    [63:0]	rs1_bypassdata,
    output  wire    [63:0]	rs2_bypassdata,
    output  wire    [63:0]	csr_bypassdata
);
    // bypassdata的优先级是 ex > mem > wb
    // 距离越近，优先级越高嘛
    assign      rs1_bypassdata  =   (   
                                        rs1_bypassdata_ex_sel 	    ? 	gpr_bypassdata_ex 	
                                        :(
                                            rs1_bypassdata_mem_sel     ?   gpr_bypassdata_mem
                                            :(
                                                rs1_bypassdata_wb_sel     ?   gpr_bypassdata_wb   : 64'b0
                                            )
                                        )
                                    );
    assign      rs2_bypassdata  =   (   
                                        rs2_bypassdata_ex_sel 	    ? 	gpr_bypassdata_ex 	
                                        :(
                                            rs2_bypassdata_mem_sel     ?   gpr_bypassdata_mem
                                            :(
                                                rs2_bypassdata_wb_sel     ?   gpr_bypassdata_wb   : 64'b0
                                            )
                                        )
                                    );
    assign      csr_bypassdata  =   (   
                                        csr_bypassdata_ex_sel 	    ? 	csr_bypassdata_ex 	
                                        :(
                                            csr_bypassdata_mem_sel     ?   csr_bypassdata_mem
                                            :(
                                                csr_bypassdata_wb_sel     ?   csr_bypassdata_wb   : 64'b0
                                            )
                                        )
                                    );

endmodule